home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.3 / Printer / src / EpsonX / density.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.4 KB  |  49 lines

  1. /*
  2.     Density module for EpsonX driver.
  3.     David Berezowski - October/87.
  4.  
  5.   Copyright (c) 1988 Commodore-Amiga, Inc.
  6.  
  7.   Executables based on this information may be used in software
  8.   for Commodore Amiga computers.  All other rights reserved.
  9.  
  10.   This information is provided "as is"; no warranties are made.
  11.   All use is at your own risk, and no liability or responsibility is assumed.
  12. */
  13.  
  14.  
  15. #include <exec/types.h>
  16. #include "../printer/printer.h"
  17. #include "../printer/prtbase.h"
  18.  
  19. SetDensity(density_code)
  20. ULONG density_code;
  21. {
  22.     extern struct PrinterData *PD;
  23.     extern struct PrinterExtendedData *PED;
  24.  
  25.     /* SPECIAL_DENSITY     0    1    2    3    4    5    6    7 */
  26.     static int XDPI[8] = {120, 120, 120, 240, 120, 240, 240, 240};
  27.     static int YDPI[8] = {72, 72, 144, 72, 216, 144, 216, 216};
  28.     static char codes[8] = {'L', 'L', 'L', 'Z', 'L', 'Z', 'Z', 'Z'};
  29.  
  30.     PED->ped_MaxColumns = 
  31.         PD->pd_Preferences.PaperSize == W_TRACTOR ? 136 : 80;
  32.     density_code /= SPECIAL_DENSITY1;
  33.     /* default is 80 chars (8.0 in.), W_TRACTOR is 136 chars (13.6 in.) */
  34.     PED->ped_MaxXDots =
  35.         (XDPI[density_code] * PED->ped_MaxColumns) / 10;
  36.     PED->ped_XDotsInch = XDPI[density_code];
  37.     PED->ped_YDotsInch = YDPI[density_code];
  38.     if ((PED->ped_YDotsInch = YDPI[density_code]) == 216) {
  39.         PED->ped_NumRows = 24;
  40.     }
  41.     else if (PED->ped_YDotsInch == 144) {
  42.         PED->ped_NumRows = 16;
  43.     }
  44.     else {
  45.         PED->ped_NumRows = 8;
  46.     }
  47.     return(codes[density_code]);
  48. }
  49.